import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

import user from './modules/user';
import manage from './modules/manage';
import content from './modules/content';
import games from './modules/games';
import statistics from './modules/statistics';
import moreActions from './modules/moreActions';
import guild_room from './modules/guild_room';
import equip from './modules/equip';
import Dailystatistics from './modules/Dailystatistics';
import luckDraw from './modules/luckDraw';
import prop from './modules/prop';
import audit from './modules/audit';
import system from './modules/system';
const Layout = () => import('@/layout/index.vue')
export const routeslist: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: 'login',
    meta:{
      title:'登陆',
      icon:'HelpFilled',
      hide:true
    },
    component:()=> import('@/views/login/index.vue')
  },
  {
    path: '/',
    name: 'index',
    meta:{
      title:'首页',
      icon:'HelpFilled',
      // hide:true
    },
    component:Layout
  },
  {
    path: '/:catchAll(.*)',
    name: 'Error',
    meta:{
      title:'404',
      hide:true
    },
    component: () => import('@/views/404.vue'),
  }
]
export const ruleRoter: Array<RouteRecordRaw> = [
  ...user,
  manage,
  ...Dailystatistics,
  content,
  {
    path: '/getDataInfo',
    name: 'GetDataInfo',
    meta: { title: '平台玩法管理',icon:'Connection' },
    component:Layout,
    children: [
      ...statistics,
    ],
  },
  {
    path: '/activity',
    name: 'Activity',
    // meta: { title: '重要活动管理',icon:'Connection' },
    meta: { title: '平台活动管理',icon:'Connection' },
    children: [
      ...games,
      ...luckDraw,
    ],
  },
  ...prop,
  ...guild_room,
  ...audit,
  system,
  moreActions,
]
const router = createRouter({
  history: createWebHashHistory(),
  routes:routeslist
})

export default router
